package me.zhengjie.modules.serviceprovider.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import me.zhengjie.modules.serviceprovider.domain.TServiceproviderPerson;
import me.zhengjie.modules.serviceprovider.service.dto.TServiceproviderPersonDTO;
import me.zhengjie.modules.serviceprovider.service.dto.TServiceproviderPersonQueryCriteria;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;

/**
* @author xuyukun
* @date 2019-07-20
*/
// @CacheConfig(cacheNames = "tServiceproviderPerson")
public interface TServiceproviderPersonService {

    /**
    * queryAll 分页
    * @param criteria
    * @param pageable
    * @return
    */
   // @Cacheable(keyGenerator = "keyGenerator")
    Object queryAll(TServiceproviderPersonQueryCriteria criteria, Pageable pageable);

    /**
    * queryAll 不分页
    * @param criteria
    * @return
    */
    //@Cacheable(keyGenerator = "keyGenerator")
    public Object queryAll(TServiceproviderPersonQueryCriteria criteria);

    /**
     * findById
     * @param id
     * @return
     */
    // @Cacheable(key = "#p0")
    TServiceproviderPersonDTO findById(Long id);

    /**
     * create
     * @param resources
     * @return
     */
    // @CacheEvict(allEntries = true)
    TServiceproviderPersonDTO create(TServiceproviderPerson resources);
    void batchCreate(java.util.List<TServiceproviderPerson> personList);

    /**
     * update
     * @param resources
     */
   // @CacheEvict(allEntries = true)
    void update(TServiceproviderPerson resources);

    /**
     * delete
     * @param id
     */
    // @CacheEvict(allEntries = true)
    void delete(Long id);

    /**
     * findbyusername
     * @param username
     * @return
     */
    TServiceproviderPersonDTO findByUsername(String username);
    //TServiceproviderPersonDTO findByAccount(String username);
    TServiceproviderPersonDTO findByPhone(String username);


    Object register(JSONObject resouces);

    Object resetpassword(JSONObject resouces);


    Object rebind(JSONObject resouces);
}